#pragma once
#include "audionode.h"

class CADSR :
	public CAudioNode
{
public:
	CADSR(void);
	~CADSR(void);

	virtual void Start();
	virtual bool Generate();

	void SetSource(CAudioNode *source) {m_source = source;}

	void SetAttack(double a) {m_attack = a;}
	void SetDecay(double d) {m_decay = d;}
	void SetRelease(double r) {m_release = r;}

	void SetDuration(double d) {m_duration = d;}

private:
	double m_attack;
	double m_decay;
	double m_release;
	double m_duration;
	double m_time;
	double m_attackFactor;
	CAudioNode *m_source;

};

